#ifndef __MCS__COMPILE_EXCEPTION__HPP
#define __MCS__COMPILE_EXCEPTION__HPP

#include "Exception.hpp"
#include "SourceLocation.hpp"

/// Exception that indicates syntax error in script sources
class CompileException : public Exception
{
public:
	CompileException(SourceLocation const & location) : Exception(), location_(location) {}
	
	SourceLocation const & location() const { return location_; }

	virtual std::ostream & stream(std::ostream & str) const
	{
		return str << location_ << ": ";
	}
private:
	SourceLocation location_;
};


#endif //__MCS__COMPILE_EXCEPTION__HPP
